const myURL = new URL('https://example.org/foo?name=jw&age=11#search');
// const myURL = new URL('https://example.org/foo#search');
console.log(myURL.hash);
console.log(myURL);
  // 打印 #bar

myURL.searchParams.sort(); //对参数进行排序
// myURL.search = '?1232';

myURL.hash = 'haha';
console.log(myURL.href);

myURL.hash = '';
console.log(myURL.href);

let url2 = new URL('ajfjfj'); //下面会报错
console.log(url2)
